home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92c.txt / 000053_icon-group-sender _Sun Nov 1 09:59:17 1992.msg < prev    next >
Internet Message Format  |  1993-01-04  |  3KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 2 Nov 1992 09:12:34 MST
  2. Date: 1 Nov 92 09:59:17 GMT
  3. From: agate!doc.ic.ac.uk!uknet!strath-cs!fulcrum!bham!news.cs.bham.ac.uk!percy!aps@ucbvax.Berkeley.EDU  (Alan P Sexton)
  4. Organization: University of Birmingham
  5. Subject: Re: semicolons
  6. Message-Id: <1992Nov1.095917@cs.bham.ac.uk>
  7. References: <199210281642.AA24982@cheltenham.cs.arizona.edu>
  8. Sender: icon-group-request@cs.arizona.edu
  9. To: icon-group@cs.arizona.edu
  10. Status: R
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12.  
  13. In article <199210281642.AA24982@cheltenham.cs.arizona.edu>, ralph@cs.arizona.edu (Ralph Griswold) writes:
  14. |> I normally stay out of "discussions" like this, but I can't resist
  15. |> remarking that, in practice, the semicolon insertion performed
  16. |> by the Icon translator works well in practice, programmers like it,
  17. |> it's been touted as one of the nice little touches that makes
  18. |> Icon a pleasure to use, and I don't recall a single complaint
  19. |> about the feature from a practicing Icon programmer (once they
  20. |> understand it).
  21. |> 
  22. |> The wisdom on idiomatic Icon programming is that semicolons should
  23. |> never appear (syntactically) in Icon programs.
  24. |> 
  25. |> If you want to argue syntax, what semicolon insertion does is
  26. |> give line terminators syntactic significance.  In most programs,
  27. |> an Icon programmer thinks of a newline (or whatever your favorite
  28. |> platform uses to terminate lines) in the same way programmers
  29. |> in languages with similar syntax think of semicolons.
  30. |>     
  31. |> Ralph E. Griswold            ralph@cs.arizona.edu
  32. |> Department of Computer Science          uunet!arizona!ralph
  33. |> The University of Arizona        602-621-6609 (voice)
  34. |> Tucson, AZ 85721            602-621-9618   (fax)
  35.  
  36. Have you looked at how Turing handles this problem? It is a
  37. pascal/euclid/modula/C-like language where (among other things) they got
  38. rid of unnecessary syntax (nothing like ``program x'' etc.)
  39. In particular semicolons are not necessary (they still allow them for the
  40. benefit of those who can't seem to program without them). The interesting part
  41. is that they are not handled by semicolon insertion: newlines are just whitespace.
  42. Careful design of the grammar and use of a `maximal scan' principle, ensures
  43. unambiguous parsing.
  44.  
  45. The whole thing has a formal definition and semantics (and was designed with
  46. these objectives in mind)
  47.  
  48. c.f. ``The Turing Programming Language: Design and Definition''
  49. R.Holt, P.Matthews, J. Rosselet, J.Cordy
  50. Prentice Hall 1988, ISBN: 0-13-933136-0
  51.  
  52. Alan P. Sexton,        Tel: 021-414 3703
  53. University of Birmingham, School of Computer Science
  54. Edgbaston, Birmingham B15 2TT, England
  55. A.P.Sexton@cs.bham.ac.uk
  56.